<!--
/**************************************************
* @(#)balancefeeview.jsp
*
* Copyright (c) 2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006-05-18, owen
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<html>
	<head>
		<title>费用类型管理</title>
		<META http-equiv=Content-Type content="text/html; charset=UTF-8">
          <LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
          <SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
          <SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
	      <SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
	  <%
        String tReQuery = (String)request.getAttribute("requery");
	    ResultProcess tBalancefeeList = (ResultProcess)request.getAttribute("balancefee");
	    ArrayList tList = new ArrayList();
     %>    
	 <script language=javascript >

	   function process(){	
	        <%
					    if(tReQuery!=null && tReQuery.equals("true")){
			%>
	        addform.action='<%= response.encodeURL(request.getContextPath() + "/A401201.do") %>';
            addform.submit();
            return true;
            <%
             }
	        %>
	   }
		
	   function add(){
           var result = null;	
		    result = showModalDialog("<%= response.encodeURL(request.getContextPath() + "/A401202.do") %>", window,"status:no;unadorned:no;dialogWidth:900px;dialogHeight:600px;help:no;");
		   
		  if(result != null){
		  addform.gs_fee_type.value=result[0];
          addform.gs_dis_no.value=result[1];
       //    alert(addform.gs_dis_no.value);
           addform.action="<%= response.encodeURL(request.getContextPath() + "/A401203.do") %>";   
           addform.submit();
        	}
            return true;
          }
          
      function mod(temp){
         pager.Id.value=temp;
         var id=null;
         id= pager.Id.value;
         var result = null;	
         //alert(id);
	     result = showModalDialog("<%= response.encodeURL(request.getContextPath() + "/A401204.do") %>?Id="+id, window,"status:no;unadorned:no;dialogWidth:900px;dialogHeight:600px;help:no;");
         if(result != null){
            addform.gs_fee_type.value=result[0];
            addform.gs_dis_no.value=result[1];
            addform.gs_fee_type_no.value=result[2];
            
            addform.action="<%= response.encodeURL(request.getContextPath() + "/A401205.do") %>";   
		    addform.submit();
			}
      return true;
      }    
      
      function del(){
        if(!isCheckBoxselected(document.pager,document.pager.Ids)){
				alert("请至少选择一个删除的结算费用信息。");
				return false;				
			}else{		
				if(confirm("是否确定删除所选结算费用信息？")){
				 				
					if(document.pager.Ids.length > 1){
						for(i=0; i<document.pager.Ids.length;i++){
							if(document.pager.Ids[i].checked){
								document.addform.gs_dis_nos[i].checked = true;
								document.addform.gs_dis_nos[i].value=document.pager.Ids[i].value;
								
							}
						}
					}else if(document.pager.Ids.checked){
							document.addform.gs_dis_nos.checked = true;
							document.addform.gs_dis_nos.value=document.pager.addform.Ids.value;
					}
					
				    addform.action="<%= response.encodeURL(request.getContextPath() + "/A401206.do") %>";   
		            addform.submit();
				    
				}else{
					return false;
				}
			}
      }
    </script>
	</head>
	<body BGCOLOR="#f2f2f2" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="process()">
			<p><br>
			</p>
            <form name="kongform" method="get">
			<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td height="20">
						<table width="100%" border="0" cellspacing="0" cellpadding="1">
							<tr height="20">
								<td height="30" width="758" class="mtxt_black">费用类型管理
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="bg_line" height="2"></td>
				</tr>
			</table>
            <%
                        if(tBalancefeeList != null) {
                            int totalRecords = 0;
                            if(request.getAttribute("totalRecords")!=null){
                                totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
                            }
                            int defaultPageSize =10;
                            if(request.getAttribute("pageSize")!=null){
                                defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
                            }
                            totalRecords=tBalancefeeList.getRecordsSize();
                        %>          
                        <page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'>
                        <% 
                        tList = tBalancefeeList.getDisplayRecords(index.intValue(),pageSize.intValue());
                        %>
                        </page:pager>
                        <%
                        } %>
            </form>
			<br>
			
			<%
	        if(tBalancefeeList != null){
            %>
            <form name ='pager'>
			<table class="bg_table" id="tableId" cellspacing="1" cellpadding="2" width="98%" align="center"
				border="0">
				<tr class="bg_column" height="20">
					<td class="top" align="center" colspan="17">
						<b>费用类型列表<input type=hidden name="Id" ></b>
					</td>
				</tr>
				
				<tr class="bg_column" height="20">
					<td class="top" align="center" width="5%">
						
					</td>
					<td class="top" align="center" width="5%">
						
					</td>
					<td class="top" align="center" width="80%">
						<div align="center" class="txt_content">费用类型</div>
					</td>
					<td class="top" align="center" width="10%">显示顺序
					</td>
				</tr>
				<%
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
							String[] tStr = (String[])tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}
					%>
				<tr <%=tTempStr%> height=20>
					<td class="top" align="center" width="5%">
						<INPUT type="checkbox" name="Ids" value="<%=tStr[0] %>">
					</td>
					<td class="top" align="center" width="5%">
						<INPUT type="button" value="修改" class="kuang" onclick="mod('<%=tStr[0] %>')">
					</td>
					<td class="top" align="center" width="80%">
						<div align="center" class="txt_content"><%=tStr[1] %></div>
					</td>
					<td class="top" align="center" width="10%">
					<%=tStr[2] %>
					</td>
				</tr>
				<%	
							}
					%>
				<tr class="bg_column" height="20">
					<td colspan="5" align="right">
						<!--显示页数-->
						<page:navigator type='text'  queryForm='kongform'/>
					</td>
				</tr>
				 <%
						}else{
			     %>
							<font color="red">没有符合条件的结算费用类型</font>
				<%
						}
				%>
			</table>
			</form>
			<%} %>
    <form action="" name="addform" method="post">
       <div style='display:none'>
		<%
			if(tList != null){
				for(int i=0; i<tList.size(); i++){
		%>
			<input type="checkbox" name="gs_dis_nos">
		<%
				}
			}
		%>	
      <input type=hidden name=gs_fee_type>	
      <input type="hidden" name="gs_dis_no">	
      <input type="hidden" name="gs_fee_type_no">	
      </div>
    </form>
		<p align="center">
			<INPUT type="button" value="添加" class="kuang" onclick="return add()">&nbsp;
			<INPUT type="button" value="删除" class="kuang" onclick="return del()">&nbsp;
		</p>
	</body>
</html>
